#ifndef MWIDGET_H
#define MWIDGET_H

#include "mdrawingboard.h"
#ifdef GUI_APPLICATION

#include "mobject.h"
#include "mstring.h"

class MApplication;
class MWindowManager;
class MWidgetPrivate;

class MWidget : public MObject, public MDrawingBoard
{
	M_DECLARE_PRIVATE(MWidget)

	protected:
		MWidget(MWidget *parent = NONE);
		virtual ~MWidget() = 0;

	public:
		int x() const;
		int y() const;
		MPoint point() const;
		int width() const;
		int height() const;
		MSize size() const;

	public:
		MString windowTitle() const;
		int attribute() const;
		int flags() const;
		Jxq::WindowState state() const;
		MColor backgroundColor() const;

	public:
		void setVisible(bool visible = true);
		void show();
		void hide();

	public:
		void move(int x, int y);
		void move(const MPoint &point);
		void resize(int width, int height);
		void resize(const MSize &size);

	public:
		void setWindowTitle(const MString &text);

	public:
		bool isHidden();

	protected:
		virtual bool event(MEvent *event);

	private:
		M_DISABLE_COPY(MWidget)
		friend class MApplication;
		friend class MWindowManager;
};


#endif //GUI_APPLICATION

#endif //MWIDGET_H
